@import "mixins/mixins";
@import "common/var";

@include b(alert) {
  width: 100%;
  //padding: getProp("alert-padding;
  @include defProp('padding', 'alert-padding');
  margin: 0;
  box-sizing: border-box;
  //border-radius: getProp("alert-border-radius;
  @include defProp('border-radius', 'alert-border-radius');
  position: relative;
  //background-color: getProp("color-white;
  @include defProp('background-color', 'color-white');
  overflow: hidden;
  opacity: 1;
  display: flex;
  align-items: center;
  transition: opacity .2s;

  @include when(light) {
    .el-alert__closebtn {
      //color: getProp("color-text-placeholder;
      @include defProp('color', 'color-text-placeholder');
    }
  }

  @include when(dark) {
    .el-alert__closebtn {
      //color: getProp("color-white;
      @include defProp('color', 'color-white');
    }
    .el-alert__description {
      //color: getProp("color-white;
      @include defProp('color', 'color-white');
    }
  }

  @include when(center) {
    justify-content: center;
  }

  @include m(success) {
    &.is-light {
      background-color: getProp("alert-success-color");
      color: getProp("color-success");

      .el-alert__description {
        color: getProp("color-success");
      }
    }

    &.is-dark {
      background-color: getProp("color-success");
      color: getProp("color-white");
    }
  }

  @include m(info) {
    &.is-light {
      background-color: getProp("alert-info-color");
      color: getProp("color-info");
    }

    &.is-dark {
      background-color: getProp("color-info");
      color: getProp("color-white");
    }

    .el-alert__description {
      color: getProp("color-info");
    }
  }

  @include m(warning) {
    &.is-light {
      background-color: getProp("alert-warning-color");
      color: getProp("color-warning");

      .el-alert__description {
        color: getProp("color-warning");
      }
    }

    &.is-dark {
      background-color: getProp("color-warning");
      color: getProp("color-white");
    }
  }

  @include m(error) {
    &.is-light {
      background-color: getProp("alert-danger-color");
      color: getProp("color-danger");

      .el-alert__description {
        color: getProp("color-danger");
      }
    }

    &.is-dark {
      background-color: getProp("color-danger");
      color: getProp("color-white");
    }
  }

  @include e(content) {
    display: table-cell;
    padding: 0 8px;
  }

  @include e(icon) {
    font-size: getProp("alert-icon-size");
    width: getProp("alert-icon-size");
    @include when(big) {
      font-size: getProp("alert-icon-large-size");
      width: getProp("alert-icon-large-size");
    }
  }

  @include e(title) {
    font-size: getProp("alert-title-font-size");
    line-height: 18px;
    @include when(bold) {
      font-weight: bold;
    }
  }

  & .el-alert__description {
    font-size: getProp("alert-description-font-size");
    margin: 5px 0 0 0;
  }

  @include e(closebtn) {
    font-size: getProp("alert-close-font-size");
    opacity: 1;
    position: absolute;
    top: 12px;
    right: 15px;
    cursor: pointer;

    @include when(customed) {
      font-style: normal;
      font-size: getProp("alert-close-customed-font-size");
      top: 9px;
    }
  }
}

.el-alert-fade-enter,
.el-alert-fade-leave-active {
  opacity: 0;
}
